#include "../../h/apue.h"
#include <fcntl.h>

#define RWRWRW (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)

int main(void)
{
    umask(0);
    if (creat("ka/foo", RWRWRW) < 0)
        err_sys("creat error for foo.");

    umask(S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
    if (creat("ka/bar1", RWRWRW) < 0)
        err_sys("creat error for bar.");

    return 0;
}
